package com.nifostasky.comic.dtos;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 用户登录请求参数
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(description = "用户APP登录信息")
public class UserAppLoginDTO implements Serializable {

    /**
     * 验证码
     */
    @ApiModelProperty(value = "验证码",required = true)
    private String verifyCode;

    /**
     * 客户端key
     */
    @ApiModelProperty(value = "客户端key",required = true)
    private String key;

    /**
     * 用户名
     */
    @ApiModelProperty(value = "用户名",required = true)
    private String userName;

    /**
     * 密码
     */
    @ApiModelProperty(value = "密码",required = true)
    private String passWord;

    @ApiModelProperty(value = "登录方式 1.web登录 2.app登录;默认为1")
    private Integer loginType;

    @ApiModelProperty(value = "登录IP",hidden = true)
    private String ip;

    @ApiModelProperty(value = "app版本",hidden = true)
    private String version;

    public Integer getLoginType() {
        return loginType == null ? 1 :loginType;
    }
}
